﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sealight.Core.Domain
{
   public class ProductReviewEntity:BaseEntity
    {
        /// <summary>
        /// Gets or sets the product review identifier
        /// </summary>
        public virtual Guid ProductReviewID { get; set; }

        /// <summary>
        /// Gets or sets the product identifier
        /// </summary>
        public virtual ProductEntity Product { get; set; }

        /// <summary>
        /// Gets or sets the customer identifier
        /// </summary>
        public virtual UserEntity User { get; set; }

        /// <summary>
        /// Gets or sets the title
        /// </summary>
        public virtual string Title { get; set; }

        /// <summary>
        /// Gets or sets the review text
        /// </summary>
        public virtual string ReviewText { get; set; }

        /// <summary>
        /// Review rating
        /// </summary>
        public virtual int Rating { get; set; }

        /// <summary>
        /// Review helpful votes total
        /// </summary>
        public virtual int HelpfulYesTotal { get; set; }

        /// <summary>
        /// Review not helpful votes total
        /// </summary>
        public virtual int HelpfulNoTotal { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the product review is approved
        /// </summary>
        public virtual bool IsApproved { get; set; }

        /// <summary>
        /// Gets or sets the date and time of instance creation
        /// </summary>
        public virtual DateTime CreatedDate { get; set; }

        public virtual Sealight.Core.DataAdapter.product_review ToDataAdapter()
        {
            return new DataAdapter.product_review {id=this.ProductReviewID, title=this.Title, created_date=this.CreatedDate, helpful_no_total=this.HelpfulNoTotal, helpful_yes_total=this.HelpfulYesTotal,
            is_approved=this.IsApproved, rating=this.Rating, review_text=this.ReviewText, product=this.Product.ToDataAdapter(), user=this.User.ToDataAdapter()};
        }
    }
}
